var mychart = echarts.init(document.getElementById("b1"));

var option ={
    series:{
        type:'graph',
        data:[{
            name: '小明',
            x: 10,
            y: 50,
        },{
            name: '小红',
            x: 50,
            y: 100,
        },{
            name: '老王',
            x: 90,
            y:50,
        }],
        symbolSize: 30,
        links: [{
            source: '小明',
            target: '老王',
        },{
            source: '小明',
            target: '小红',
        },{
            source: '小红',
            target: '老王',
        }],
    },
    title:{
        text:'成绩占比',
        subtext:'沈林涛',
    },
};
mychart.setOption(option);

var mychart2 = echarts.init(document.getElementById("b2"));

var option2 ={
    series:{
        type:'graph',
        data:[{
            name: '小明',
            x: 10,
            y: 50,
        },{
            name: '小红',
            x: 50,
            y: 100,
        },{
            name: '老王',
            x: 90,
            y:50,
        }],
        symbolSize: 30,
        symbol: 'roundRect',
        links: [{
            source: '小明',
            target: '老王',
            lineStyle: {
                color: 'green',
                width: 10,
            },
            label: {
                formatter: '邻居',
                show: true,
            },
        },{
            source: '小明',
            target: '小红',
            lineStyle: {
                color: 'yellow',
                width: 10,
            },
            label: {
                formatter: '情人',
                show: true,
            },
        },{
            source: '小红',
            target: '老王',
            lineStyle: {
                color: 'red',
                width: 10,
            },
            label: {
                formatter: '老相好',
                show: true,
            },
        }],
        itemStyle: {
            color: 'red',
            borderColor: 'black',
        },
        label: {
            show: true,
            position: 'top',
        },
    },
    title:{
        text:'成绩占比',
        subtext:'沈林涛',
    },
};
mychart2.setOption(option2);


var mychart3 = echarts.init(document.getElementById("b3"));
var option3 ={
    series:{
        type:'graph',
        data:[{
            name: '小明',
            x: 10,
            y: 50,
        },{
            name: '小红',
            x: 50,
            y: 100,
        },{
            name: '老王',
            x: 90,
            y:50,
        }],
        symbolSize: 30,
        symbol: 'image://./114514.png',
        links: [{
            source: '小明',
            target: '老王',
            lineStyle: {
                color: 'green',
                width: 10,
            },
            label: {
                formatter: '邻居',
                show: true,
            },
        },{
            source: '小明',
            target: '小红',
            lineStyle: {
                color: 'yellow',
                width: 10,
            },
            label: {
                formatter: '情人',
                show: true,
            },
        },{
            source: '小红',
            target: '老王',
            lineStyle: {
                color: 'red',
                width: 10,
            },
            label: {
                formatter: '老相好',
                show: true,
            },
        }],
        itemStyle: {
            color: 'red',
            borderColor: 'black',
        },
        label: {
            show: true,
            position: 'top',
        },
    },
    title:{
        text:'成绩占比',
        subtext:'沈林涛',
    },
};
mychart3.setOption(option3);

var mychart4 = echarts.init(document.getElementById("b4"));
var option4 ={
    series:{
        type:'graph',
        layout: 'force',
        force: {
            replusion: 1000,
        },
        roam: true,
        draggable: true,
        label:{
            show:true,
            position: 'bottom',
        },
        data:[{
            name: '小明',
            symbol: 'image://./114514.png',
            x:10,
            y:50,
        },{
            name: '小红',
            symbol: 'image://./2222.png',
            x:50,
            y:100,
        },{
            name: '老王',
            symbol: 'image://./3333.png',
            x: 90,
            y:50,
        }],
        symbolSize: 30,
        // symbol: 'image://./114514.png',
        links: [{
            source: '小明',
            target: '老王',
        },{
            source: '小明',
            target: '小红',
        },{
            source: '小红',
            target: '老王',
        }],
    },
    title:{
        text:'成绩占比',
        subtext:'沈林涛',
    },
};
mychart4.setOption(option4);


var mychart5 = echarts.init(document.getElementById("b5"));
var option5 ={
    series:{
        type:'graph',
        layout: 'force',
        force: {
            repulsion: 1500,
        },
        roam: true,
        draggable: true,
        label:{
            show:true,
            position: 'bottom',
        },
        data:[{
            name: '小明',
        },{
            name: '小红',
        },{
            name: '老王',
        },{
            name: '小孙',
        },{
            name: '小吴',
        },{
            name: '小赵',
        },{
            name: '小周',
        },{
            name: '小钱',
        },{
            name: '小李',
        }],
        symbolSize: 30,
        links: [{
            source: '小明',
            target: '老王',
        },{
            source: '小明',
            target: '小红',
        },{
            source: '小红',
            target: '老王',
        },{
            source: '小红',
            target: '小孙',
        },{
            source: '老王',
            target: '小吴',
        },{
            source: '小赵',
            target: '老王',
        },{
            source: '小赵',
            target: '小周',
        },{
            source: '小赵',
            target: '小钱',
        },{
            source: '小钱',
            target: '小李',
        }],
    },
    title:{
        text:'成绩占比',
        subtext:'沈林涛',
    },
};
mychart5.setOption(option5);

var myChart6 = echarts.init(document.getElementById("b6"))
var option6 = {
    series:{
        type:'graph',
        layout: 'circular',
        label: {
            show: true,
        },
        data: [{
            name: '小明',
        },{
            name: '小红',
        },{
            name: '老王',
        },{
            name: '小王',
        },{
            name: '小刘',
        },{
            name: '小李',
        },{
            name: '小赵',
        },],
        symbolSize: 30,
        links:[{
            source:'小明',
            target:'老王',
        },{
            source:'小红',
            target:'小明',
        },{
            source:'小红',
            target:'老王',
        },],
    },
    title:{
        text:'成绩占比',
        subtext:'沈林涛',
    },
};
myChart6.setOption(option6);
